<%@page pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<%@ page import="java.util.ArrayList" %>
<%@ page import="slim3.demo.controller.six.FlightBean_Intl" %>
<%@ page import="slim3.demo.controller.six.FlightBean" %>
<%@ page import="slim3.demo.controller.six.FlightBean_DomesticArrival" %>
<%@ page import="slim3.demo.controller.six.AirportBean" %>

<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta content="120; url=http://apbfour.appspot.com/six/six" http-equiv="refresh">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>松山機場 - 今日所有航班資訊</title>
<link rel="stylesheet" type="text/css" href="blueprint/screen.css" />
<link href="css/web20.css" rel="stylesheet" type="text/css" media="screen" />

<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
<link rel="apple-touch-startup-image" href="apple-touch-icon.png" />

<script type="text/javascript" src="./jquery/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
// When document is ready: this gets fired before body onload :)
$(document).ready(function(){
	// Write on keyup event of keyword input element
	$("#kwd_search").keyup(function(){
		// When value of the input is not blank
		if( $(this).val() != "")
		{
			// Show only matching TR, hide rest of them
			$("#my-table tbody>tr").hide();
			$("#my-table td:contains-ci('" + $(this).val() + "')").parent("tr").show();
		}
		else
		{
			// When there is no input or clean again, show everything back
			$("#my-table tbody>tr").show();
		}
	});
});
// jQuery expression for case-insensitive filter
$.extend($.expr[":"], 
{
    "contains-ci": function(elem, i, match, array) 
	{
		return (elem.textContent || elem.innerText || $(elem).text() || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
	}
});

</script>

<style>

body{
	margin:0;
	padding:0;
	background:#f1f1f1;
	color:#555;
	line-height:170%;
	text-align:left;
	font-family: "標楷體", Arial, Helvetica, sans-serif;
}
a{
	text-decoration:none;
	color:#057fac;
}
a:hover{
	text-decoration:none;
	color:#999;
}
</style>


<script type="text/javascript">
<!--
function reload(condition) {
	if (condition == "yes") {
		document.location.reload(true);
	}
}
//-->
</script>


<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33867276-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


</head>
<body>
<script type="text/javascript" src="wz_tooltip/wz_tooltip.js"></script>

<center>
  <p class="notice"><font color="#CC6600" size="+1">此網頁每隔2分鐘將自動重新整理&nbsp;&nbsp;&nbsp;&nbsp;<a href="list"><font color="0000FF">主目錄</font></a></font></p><br>
  <%
	String year = (String) request.getAttribute("year");
	String month = (String) request.getAttribute("month");
	String day = (String) request.getAttribute("day");
	String hour = (String) request.getAttribute("hour");
	String minute = (String) request.getAttribute("minute");
	String second = (String) request.getAttribute("second");

	//ArrayList<AirportBean> airportlist = (ArrayList<AirportBean>) request.getAttribute("airportlist");
  %>
    <font size="+2">航空警察局台北分局 - 發證室<br />
    中華民國<%=year %>年<%=month %>月<%=day %>日<%=hour %>時<%=minute %>分<%=second %>秒<br />
    松山機場 - 今日所有航班資訊</font>

<p><font color="#0000FF" size="+1" face="Verdana">即時搜尋：<input type="text" id="kwd_search" value=""/></font></p>
 
</center>

<table width="100%" border="0" id="my-table">

  <thead>
  <tr>
    <td align="center"><font size="+2" face="標楷體">國際入境</font></td>
    <td align="center"><font size="+2" face="標楷體">國際出境</font></td>
    <td align="center"><font size="+2" face="標楷體">國內抵達</font></td>
    <td align="center"><font size="+2" face="標楷體">國內出發</font></td>
  </tr>
  </thead>

  <tr>
<!--第一欄 - 國際入境-->
    <td align="center" valign="top">
	
	<table cellspacing="0" cellpadding="0" width="100%">
	<thead>
		<tr>			
			<th align="center">自</th>
			<th align="center">航空</th>
			<th align="center">編號</th>
			<th align="center">抵達</th>
			<th align="center">實際</th>
			<th align="center">狀態</th>
		</tr>
	</thead>
		
		<%
			ArrayList<FlightBean_Intl> beans1 = (ArrayList<FlightBean_Intl>) request.getAttribute("intl_arrival");
			String temp = "";
		%>
		<%
			if (beans1.size()==0) {
		%>		
				</table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
				<script type="text/javascript" language="JavaScript">
         			reload("yes");
      			</script>
		<%
			} else {
		%>
	<tbody>
		<%
			for (int i=0; i<beans1.size(); i++) {
		%>
			<tr>
				<td align="center">
					<%
						if (beans1.get(i).getOrigin().equals("TSN")) {
							temp = "天津";
						} else if (beans1.get(i).getOrigin().equals("TYN")) {
							temp = "太原";
						} else if (beans1.get(i).getOrigin().equals("HFE")) {
							temp = "合肥";
						} else if (beans1.get(i).getOrigin().equals("CTU")) {
							temp = "成都";
						} else if (beans1.get(i).getOrigin().equals("HND")) {
							temp = "羽田";
						} else if (beans1.get(i).getOrigin().equals("HGH")) {
							temp = "杭州";
						} else if (beans1.get(i).getOrigin().equals("WUH")) {
							temp = "武漢";
						} else if (beans1.get(i).getOrigin().equals("GMP")) {
							temp = "金浦";
						} else if (beans1.get(i).getOrigin().equals("NNG")) {
							temp = "南寧";
						} else if (beans1.get(i).getOrigin().equals("SHA")) {
							temp = "虹橋";
						} else if (beans1.get(i).getOrigin().equals("CKG")) {
							temp = "重慶";
						} else if (beans1.get(i).getOrigin().equals("PVG")) {
							temp = "浦東";
						} else if (beans1.get(i).getOrigin().equals("HAK")) {
							temp = "海口";
						} else if (beans1.get(i).getOrigin().equals("XMN")) {
							temp = "廈門";
						} else if (beans1.get(i).getOrigin().equals("WNZ")) {
							temp = "溫州";
						} else if (beans1.get(i).getOrigin().equals("FOC")) {
							temp = "福州";
						} else {
							temp = beans1.get(i).getOrigin();
						}
					%>
					<%=temp %>
				</td>
								
				<td align="center">
					<%
						String airline = "";
						String airlineShort = "";
						if (beans1.get(i).getAirline().equals("FM")) {
							temp = "./logos/fm.gif";
							airline = "中國上海航空(上航)";
							airlineShort = "上航";
						} else if (beans1.get(i).getAirline().equals("NH")) {
							temp = "./logos/nh.png";
							airline = "全日本空輸(全日空)";
							airlineShort = "全日空";
						} else if (beans1.get(i).getAirline().equals("CA")) {
							temp = "./logos/ca.png";
							airline = "中國國際航空(國航)";
							airlineShort = "國航";
						} else if (beans1.get(i).getAirline().equals("3U")) {
							temp = "./logos/3u.gif";
							airline = "四川航空(川航)";
							airlineShort = "川航";
						} else if (beans1.get(i).getAirline().equals("MF")) {
							temp = "./logos/mf.jpg";
							airline = "廈門航空(廈航)";
							airlineShort = "廈航";
						} else if (beans1.get(i).getAirline().equals("GE")) {
							temp = "./logos/ge.gif";
							airline = "復興航空(復興)";
							airlineShort = "復興";
						} else if (beans1.get(i).getAirline().equals("TW")) {
							temp = "./logos/tw.png";
							airline = "德威航空(德威)";
							airlineShort = "德威";
						} else if (beans1.get(i).getAirline().equals("JL")) {
							temp = "./logos/jl.png";
							airline = "日本航空(日航)";
							airlineShort = "日航";
						} else if (beans1.get(i).getAirline().equals("ESR")) {
							temp = "./logos/esr.png";
							airline = "易斯達航空(易斯達)";
							airlineShort = "易斯達";
						} else if (beans1.get(i).getAirline().equals("ZE")) {
							temp = "./logos/esr.png";
							airline = "易斯達航空(易斯達)";
							airlineShort = "易斯達";
						} else if (beans1.get(i).getAirline().equals("MU")) {
							temp = "./logos/mu.png";
							airline = "中國東方航空(東航)";
							airlineShort = "東航";
						} else if (beans1.get(i).getAirline().equals("AE")) {
							temp = "./logos/ae.png";
							airline = "華信航空(華信)";
							airlineShort = "華信";
						} else if (beans1.get(i).getAirline().equals("CI")) {
							temp = "./logos/ci.gif";
							airline = "中華航空(華航)";
							airlineShort = "華航";
						} else if (beans1.get(i).getAirline().equals("FE")) {
							temp = "./logos/fe.gif";
							airline = "遠東航空(遠東)";
							airlineShort = "遠東";
						} else if (beans1.get(i).getAirline().equals("BR")) {
							temp = "./logos/br.png";
							airline = "長榮航空(長榮)";
							airlineShort = "長榮";
						} else if (beans1.get(i).getAirline().equals("B7")) {
							temp = "./logos/b7.gif";
							airline = "立榮航空(立榮)";
							airlineShort = "立榮";
						} else {
							temp = beans1.get(i).getAirline();
							airline = beans1.get(i).getAirline();
							airlineShort = beans1.get(i).getAirline();
						}
					%>
					<!-- <img src="<%=temp %>" align="absmiddle" alt="<%=airline %>" onmouseover="Tip('<%=airline %>')" onmouseout="UnTip()"> -->
					<%=airlineShort %>
				</td>
				
				<td align="center">
					<%
						temp = beans1.get(i).getAirline() + "-" + beans1.get(i).getFlightNo();
					%>
						<%=temp %>
				</td>
				
				<td align="center">
					<%
						temp = beans1.get(i).getSchedTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans1.get(i).getActualTime().equals(beans1.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						temp = beans1.get(i).getActualTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans1.get(i).getActualTime().equals(beans1.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						if (beans1.get(i).getStatus().substring(4).equals("On Time")) {
							temp = "<font color=\"#009900\">準時</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Arrived")) {
							temp = "<font color=\"#666666\">已到</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Departed")) {
							temp = "<font color=\"#666666\">已飛</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Delayed")) {
							temp = "<font color=\"#FF0000\">延誤</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Cancel")) {
							temp = "<font color=\"#FF0000\">取消</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Boarding")) {
							temp = "<font color=\"#0033FF\">登機中</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Examining")) {
							temp = "<font color=\"#0033FF\">安檢中</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Check In")) {
							temp = "<font color=\"#0033FF\">報到中</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Extra")) {
							temp = "<font color=\"#FF0000\">加班機</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Early")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("EARLY")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Divert")) {
							temp = "<font color=\"#FF0000\">轉降</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Return")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Retuen")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Charter")) {
							temp = "<font color=\"#FF0000\">包機</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("Close")) {
							temp = "<font color=\"#FF0000\">關場</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("LandInTaoYuan")) {
							temp = "<font color=\"#FF0000\">轉降桃園</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("TEST")) {
							temp = "<font color=\"#FF0000\">航班測試TEST</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("LandInGaoXiong")) {
							temp = "<font color=\"#FF0000\">轉降高雄</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("LandInBeiGan")) {
							temp = "<font color=\"#FF0000\">轉降北竿</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("FlyFromTaoYuan")) {
							temp = "<font color=\"#FF0000\">由桃園機場搭機</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("LandInTaiZhong")) {
							temp = "<font color=\"#FF0000\">轉降臺中</font>";
						} else if (beans1.get(i).getStatus().substring(4).equals("ScheduleChanged")) {
							temp = "<font color=\"#FF0000\">時間更改</font>";
						} else {
							temp = "<font color=\"#FF0000\">特殊情況</font>";
						}
					%>
					<%=temp %>
				</td>
			</tr>
		
		<%
			}
			}
		%>

	</tbody>
	</table>

	</td>
	
	
<!--第二欄 - 國際出境-->
	<td align="center" valign="top">
	
	<table cellspacing="0" cellpadding="0" width="100%">
	<thead>
		<tr>			
			<th align="center">去</th>
			<th align="center">航空</th>
			<th align="center">編號</th>
			<th align="center">起飛</th>
			<th align="center">實際</th>
			<th align="center">狀態</th>
		</tr>
	</thead>
		
		<%
			ArrayList<FlightBean_Intl> beans2 = (ArrayList<FlightBean_Intl>) request.getAttribute("intl_departure");
			temp = "";
		%>
		<%
			if (beans2.size()==0) {
		%>		
	  </table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
				<script type="text/javascript" language="JavaScript">
         			reload("yes");
      			</script>
		<%
			} else {
		%>
	<tbody>
		<%
			for (int i=0; i<beans2.size(); i++) {
		%>
			<tr>
				<td align="center">
					<%
						if (beans2.get(i).getDestination().equals("TSN")) {
							temp = "天津";
						} else if (beans2.get(i).getDestination().equals("TYN")) {
							temp = "太原";
						} else if (beans2.get(i).getDestination().equals("HFE")) {
							temp = "合肥";
						} else if (beans2.get(i).getDestination().equals("CTU")) {
							temp = "成都";
						} else if (beans2.get(i).getDestination().equals("HND")) {
							temp = "羽田";
						} else if (beans2.get(i).getDestination().equals("HGH")) {
							temp = "杭州";
						} else if (beans2.get(i).getDestination().equals("WUH")) {
							temp = "武漢";
						} else if (beans2.get(i).getDestination().equals("GMP")) {
							temp = "金浦";
						} else if (beans2.get(i).getDestination().equals("NNG")) {
							temp = "南寧";
						} else if (beans2.get(i).getDestination().equals("SHA")) {
							temp = "虹橋";
						} else if (beans2.get(i).getDestination().equals("CKG")) {
							temp = "重慶";
						} else if (beans2.get(i).getDestination().equals("PVG")) {
							temp = "浦東";
						} else if (beans2.get(i).getDestination().equals("HAK")) {
							temp = "海口";
						} else if (beans2.get(i).getDestination().equals("XMN")) {
							temp = "廈門";
						} else if (beans2.get(i).getDestination().equals("WNZ")) {
							temp = "溫州";
						} else if (beans2.get(i).getDestination().equals("FOC")) {
							temp = "福州";
						} else {
							temp = beans2.get(i).getDestination();
						}
					%>
					<%=temp %>
				</td>
								
				<td align="center">
					<%
						String airline = "";
						String airlineShort = "";
						if (beans2.get(i).getAirline().equals("FM")) {
							temp = "./logos/fm.gif";
							airline = "中國上海航空(上航)";
							airlineShort = "上航";
						} else if (beans2.get(i).getAirline().equals("NH")) {
							temp = "./logos/nh.png";
							airline = "全日本空輸(全日空)";
							airlineShort = "全日空";
						} else if (beans2.get(i).getAirline().equals("CA")) {
							temp = "./logos/ca.png";
							airline = "中國國際航空(國航)";
							airlineShort = "國航";
						} else if (beans2.get(i).getAirline().equals("3U")) {
							temp = "./logos/3u.gif";
							airline = "四川航空(川航)";
							airlineShort = "川航";
						} else if (beans2.get(i).getAirline().equals("MF")) {
							temp = "./logos/mf.jpg";
							airline = "廈門航空(廈航)";
							airlineShort = "廈航";
						} else if (beans2.get(i).getAirline().equals("GE")) {
							temp = "./logos/ge.gif";
							airline = "復興航空(復興)";
							airlineShort = "復興";
						} else if (beans2.get(i).getAirline().equals("TW")) {
							temp = "./logos/tw.png";
							airline = "德威航空(德威)";
							airlineShort = "德威";
						} else if (beans2.get(i).getAirline().equals("JL")) {
							temp = "./logos/jl.png";
							airline = "日本航空(日航)";
							airlineShort = "日航";
						} else if (beans2.get(i).getAirline().equals("ESR")) {
							temp = "./logos/esr.png";
							airline = "易斯達航空(易斯達)";
							airlineShort = "易斯達";
						} else if (beans2.get(i).getAirline().equals("ZE")) {
							temp = "./logos/esr.png";
							airline = "易斯達航空(易斯達)";
							airlineShort = "易斯達";
						} else if (beans2.get(i).getAirline().equals("MU")) {
							temp = "./logos/mu.png";
							airline = "中國東方航空(東航)";
							airlineShort = "東航";
						} else if (beans2.get(i).getAirline().equals("AE")) {
							temp = "./logos/ae.png";
							airline = "華信航空(華信)";
							airlineShort = "華信";
						} else if (beans2.get(i).getAirline().equals("CI")) {
							temp = "./logos/ci.gif";
							airline = "中華航空(華航)";
							airlineShort = "華航";
						} else if (beans2.get(i).getAirline().equals("FE")) {
							temp = "./logos/fe.gif";
							airline = "遠東航空(遠東)";
							airlineShort = "遠東";
						} else if (beans2.get(i).getAirline().equals("BR")) {
							temp = "./logos/br.png";
							airline = "長榮航空(長榮)";
							airlineShort = "長榮";
						} else if (beans2.get(i).getAirline().equals("B7")) {
							temp = "./logos/b7.gif";
							airline = "立榮航空(立榮)";
							airlineShort = "立榮";
						} else {
							temp = beans2.get(i).getAirline();
							airline = beans2.get(i).getAirline();
							airlineShort = beans2.get(i).getAirline();
						}
					%>
					<!-- <img src="<%=temp %>" align="absmiddle" alt="<%=airline %>" onmouseover="Tip('<%=airline %>')" onmouseout="UnTip()"> -->
					<%=airlineShort %>
				</td>
				
				<td align="center">
					<%
						temp = beans2.get(i).getAirline() + "-" + beans2.get(i).getFlightNo();
					%>
						<%=temp %>
				</td>
				
				<td align="center">
					<%
						temp = beans2.get(i).getSchedTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans2.get(i).getActualTime().equals(beans2.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						temp = beans2.get(i).getActualTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans2.get(i).getActualTime().equals(beans2.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						if (beans2.get(i).getStatus().substring(4).equals("On Time")) {
							temp = "<font color=\"#009900\">準時</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Arrived")) {
							temp = "<font color=\"#666666\">已到</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Departed")) {
							temp = "<font color=\"#666666\">已飛</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Delayed")) {
							temp = "<font color=\"#FF0000\">延誤</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Cancel")) {
							temp = "<font color=\"#FF0000\">取消</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Boarding")) {
							temp = "<font color=\"#0033FF\">登機中</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Examining")) {
							temp = "<font color=\"#0033FF\">安檢中</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Check In")) {
							temp = "<font color=\"#0033FF\">報到中</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Extra")) {
							temp = "<font color=\"#FF0000\">加班機</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Early")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("EARLY")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Divert")) {
							temp = "<font color=\"#FF0000\">轉降</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Return")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Retuen")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Charter")) {
							temp = "<font color=\"#FF0000\">包機</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("Close")) {
							temp = "<font color=\"#FF0000\">關場</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("LandInTaoYuan")) {
							temp = "<font color=\"#FF0000\">轉降桃園</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("TEST")) {
							temp = "<font color=\"#FF0000\">航班測試TEST</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("LandInGaoXiong")) {
							temp = "<font color=\"#FF0000\">轉降高雄</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("LandInBeiGan")) {
							temp = "<font color=\"#FF0000\">轉降北竿</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("FlyFromTaoYuan")) {
							temp = "<font color=\"#FF0000\">由桃園機場搭機</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("LandInTaiZhong")) {
							temp = "<font color=\"#FF0000\">轉降臺中</font>";
						} else if (beans2.get(i).getStatus().substring(4).equals("ScheduleChanged")) {
							temp = "<font color=\"#FF0000\">時間更改</font>";
						} else {
							temp = "<font color=\"#FF0000\">特殊情況</font>";
						}
					%>
					<%=temp %>
				</td>
			</tr>
		
		<%
			}
			}
		%>

	</tbody>
	</table>
	
	</td>
	
	
<!--第三欄 - 國內入境-->
    <td align="center" valign="top">
	
	<table cellspacing="0" cellpadding="0" width="100%">
	<thead>
		<tr>			
			<th align="center">自</th>
			<th align="center">航空</th>
			<th align="center">編號</th>
			<th align="center">抵達</th>
			<th align="center">實際</th>
			<th align="center">狀態</th>
		</tr>
	</thead>

		<%
			ArrayList<FlightBean_DomesticArrival> beans3 = (ArrayList<FlightBean_DomesticArrival>) request.getAttribute("domestic_arrival");
			temp = "";
		%>
		<%
			if (beans3.size()==0) {
		%>		
				</table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
				<script type="text/javascript" language="JavaScript">
         			reload("yes");
      			</script>
		<%
			} else {
		%>
	<tbody>
		<%
			for (int i=0; i<beans3.size(); i++) {
		%>
		
			<tr>
				<td align="center">
					<%
						if (beans3.get(i).getOrigin().equals("MFK")) {
							temp = "北竿";
						} else if (beans3.get(i).getOrigin().equals("LZN")) {
							temp = "南竿";
						} else if (beans3.get(i).getOrigin().equals("KNH")) {
							temp = "金門";
						} else if (beans3.get(i).getOrigin().equals("MZG")) {
							temp = "馬公";
						} else if (beans3.get(i).getOrigin().equals("HUN")) {
							temp = "花蓮";
						} else if (beans3.get(i).getOrigin().equals("TTT")) {
							temp = "台東";
						} else if (beans3.get(i).getOrigin().equals("HCN")) {
							temp = "恆春";
						} else if (beans3.get(i).getOrigin().equals("KHH")) {
							temp = "高雄";
						} else {
							temp = beans3.get(i).getOrigin();
						}
					%>
					<%=temp %>
				</td>
				
				<td align="center">
					<%
						String airline = "";
						String airlineShort = "";
						if (beans3.get(i).getAirline().equals("B7")) {
							temp = "./logos/b7.gif";
							airline = "立榮航空";
							airlineShort = "立榮";
						} else if (beans3.get(i).getAirline().equals("GE")) {
							temp = "./logos/ge.gif";
							airline = "復興航空";
							airlineShort = "復興";
						} else if (beans3.get(i).getAirline().equals("FE")) {
							temp = "./logos/fe.gif";
							airline = "遠東航空";
							airlineShort = "遠東";
						} else if (beans3.get(i).getAirline().equals("AE")) {
							temp = "./logos/ae.png";
							airline = "華信航空";
							airlineShort = "華信";
						} else {
							temp = beans3.get(i).getAirline();
							airline = beans3.get(i).getAirline();
							airlineShort = beans3.get(i).getAirline();
						}
					%>
					<!-- <img src="<%=temp %>" align="absmiddle" alt="<%=airline %>" onMouseOver="Tip('<%=airline %>')" onMouseOut="UnTip()"> -->
					<%=airlineShort %>
				</td>
				
				<td align="center">
					<%
						temp = beans3.get(i).getAirline() + "-" + beans3.get(i).getFlightNo();
					%>
						<%=temp %>
				</td>
				
				<td align="center">
					<%
						temp = beans3.get(i).getSchedArrivalTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans3.get(i).getActualArrivalTime().equals(beans3.get(i).getSchedArrivalTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						temp = beans3.get(i).getActualArrivalTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans3.get(i).getActualArrivalTime().equals(beans3.get(i).getSchedArrivalTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						if (beans3.get(i).getStatus().substring(4).equals("On Time")) {
							temp = "<font color=\"#009900\">準時</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Arrived")) {
							temp = "<font color=\"#666666\">已到</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Departed")) {
							temp = "<font color=\"#666666\">已飛</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Delayed")) {
							temp = "<font color=\"#FF0000\">延誤</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Cancel")) {
							temp = "<font color=\"#FF0000\">取消</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Boarding")) {
							temp = "<font color=\"#0033FF\">登機中</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Examining")) {
							temp = "<font color=\"#0033FF\">安檢中</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Check In")) {
							temp = "<font color=\"#0033FF\">報到中</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Extra")) {
							temp = "<font color=\"#FF0000\">加班機</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Early")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("EARLY")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Divert")) {
							temp = "<font color=\"#FF0000\">轉降</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Return")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Retuen")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Charter")) {
							temp = "<font color=\"#FF0000\">包機</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("Close")) {
							temp = "<font color=\"#FF0000\">關場</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("LandInTaoYuan")) {
							temp = "<font color=\"#FF0000\">轉降桃園</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("TEST")) {
							temp = "<font color=\"#FF0000\">航班測試TEST</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("LandInGaoXiong")) {
							temp = "<font color=\"#FF0000\">轉降高雄</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("LandInBeiGan")) {
							temp = "<font color=\"#FF0000\">轉降北竿</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("FlyFromTaoYuan")) {
							temp = "<font color=\"#FF0000\">由桃園機場搭機</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("LandInTaiZhong")) {
							temp = "<font color=\"#FF0000\">轉降臺中</font>";
						} else if (beans3.get(i).getStatus().substring(4).equals("ScheduleChanged")) {
							temp = "<font color=\"#FF0000\">時間更改</font>";
						} else {
							temp = "<font color=\"#FF0000\">特殊情況</font>";
						}
					%>
					<%=temp %>
				</td>
			</tr>
		
		<%
			}
			}
		%>

	</tbody>
	</table>
	
	</td>
<!--第四欄 - 國內出境-->
    <td align="center" valign="top">
	
	<table cellspacing="0" cellpadding="0" width="100%">
	<thead>
		<tr>			
			<th align="center">去</th>
			<th align="center">航空</th>
			<th align="center">編號</th>
			<th align="center">起飛</th>
			<th align="center">實際</th>
			<th align="center">狀態</th>
		</tr>
	</thead>

		<%
			ArrayList<FlightBean> beans4 = (ArrayList<FlightBean>) request.getAttribute("domestic_departure");
			temp = "";
		%>
		<%
			if (beans4.size()==0) {
		%>		
				</table><font color="#FF0000" size="+2">請稍等一下，為您重新讀取松山機場資料庫！</font>
				<script type="text/javascript" language="JavaScript">
         			reload("yes");
      			</script>
		<%
			} else {
		%>
	<tbody>
		<%
			for (int i=0; i<beans4.size(); i++) {
		%>
		
			<tr>
				<td align="center">
					<%
						if (beans4.get(i).getDestination().equals("MFK")) {
							temp = "北竿";
						} else if (beans4.get(i).getDestination().equals("LZN")) {
							temp = "南竿";
						} else if (beans4.get(i).getDestination().equals("KNH")) {
							temp = "金門";
						} else if (beans4.get(i).getDestination().equals("MZG")) {
							temp = "馬公";
						} else if (beans4.get(i).getDestination().equals("HUN")) {
							temp = "花蓮";
						} else if (beans4.get(i).getDestination().equals("TTT")) {
							temp = "台東";
						} else if (beans4.get(i).getDestination().equals("HCN")) {
							temp = "恆春";
						} else if (beans4.get(i).getDestination().equals("KHH")) {
							temp = "高雄";
						} else {
							temp = beans4.get(i).getDestination();
						}
					%>
					<%=temp %>
				</td>
				
				<td align="center">
					<%
						String airline = "";
						String airlineShort = "";
						if (beans4.get(i).getAirline().equals("B7")) {
							temp = "./logos/b7.gif";
							airline = "立榮航空";
							airlineShort = "立榮";
						} else if (beans4.get(i).getAirline().equals("GE")) {
							temp = "./logos/ge.gif";
							airline = "復興航空";
							airlineShort = "復興";
						} else if (beans4.get(i).getAirline().equals("FE")) {
							temp = "./logos/fe.gif";
							airline = "遠東航空";
							airlineShort = "遠東";
						} else if (beans4.get(i).getAirline().equals("AE")) {
							temp = "./logos/ae.png";
							airline = "華信航空";
							airlineShort = "華信";
						} else {
							temp = beans4.get(i).getAirline();
							airline = beans4.get(i).getAirline();
							airlineShort = beans4.get(i).getAirline();
						}
					%>
					<!-- <img src="<%=temp %>" align="absmiddle" alt="<%=airline %>" onMouseOver="Tip('<%=airline %>')" onMouseOut="UnTip()"> -->
					<%=airlineShort %>
				</td>
				
				<td align="center">
					<%
						temp = beans4.get(i).getAirline() + "-" + beans4.get(i).getFlightNo();
					%>
						<%=temp %>
				</td>
				
				<td align="center">
					<%
						temp = beans4.get(i).getSchedTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans4.get(i).getActualTime().equals(beans4.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						temp = beans4.get(i).getActualTime();
						temp = temp.substring(0, 2) + ":" + temp.substring(2);
					%>
					<%
						if (beans4.get(i).getActualTime().equals(beans4.get(i).getSchedTime())) {
					%>
						<%=temp %>
					<%
						} else {
					%>
						<font color=#FF0000><%=temp %></font>
					<%
						}
					%>
				</td>
				
				<td align="center">
					<%
						if (beans4.get(i).getStatus().substring(4).equals("On Time")) {
							temp = "<font color=\"#009900\">準時</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Arrived")) {
							temp = "<font color=\"#666666\">已到</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Departed")) {
							temp = "<font color=\"#666666\">已飛</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Delayed")) {
							temp = "<font color=\"#FF0000\">延誤</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Cancel")) {
							temp = "<font color=\"#FF0000\">取消</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Boarding")) {
							temp = "<font color=\"#0033FF\">登機中</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Examining")) {
							temp = "<font color=\"#0033FF\">安檢中</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Check In")) {
							temp = "<font color=\"#0033FF\">報到中</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Extra")) {
							temp = "<font color=\"#FF0000\">加班機</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Early")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("EARLY")) {
							temp = "<font color=\"#FF0000\">提早</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Divert")) {
							temp = "<font color=\"#FF0000\">轉降</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Return")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Retuen")) {
							temp = "<font color=\"#FF0000\">返航松山</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Charter")) {
							temp = "<font color=\"#FF0000\">包機</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("Close")) {
							temp = "<font color=\"#FF0000\">關場</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("LandInTaoYuan")) {
							temp = "<font color=\"#FF0000\">轉降桃園</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("TEST")) {
							temp = "<font color=\"#FF0000\">航班測試TEST</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("LandInGaoXiong")) {
							temp = "<font color=\"#FF0000\">轉降高雄</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("LandInBeiGan")) {
							temp = "<font color=\"#FF0000\">轉降北竿</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("FlyFromTaoYuan")) {
							temp = "<font color=\"#FF0000\">由桃園機場搭機</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("LandInTaiZhong")) {
							temp = "<font color=\"#FF0000\">轉降臺中</font>";
						} else if (beans4.get(i).getStatus().substring(4).equals("ScheduleChanged")) {
							temp = "<font color=\"#FF0000\">時間更改</font>";
						} else {
							temp = "<font color=\"#FF0000\">特殊情況</font>";
						}
					%>
					<%=temp %>
				</td>
			</tr>
		
		<%
			}
			}
		%>

	</tbody>
	</table>
	
	</td>
  </tr>
</table>

<center>
<font size="2" face="Arial" color="#777777">航班資料由<a href="http://www.tsa.gov.tw" target="_blank">松山機場</a>提供</font>
</center>
</body>
</html>